import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 牛客网.简单题.截取字符串
 */

class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int k = scanner.nextInt();
        StringBuilder sB = new StringBuilder();
        for(int i = 0; i < k; i++) {
            sB.append(s.charAt(i));
        }
        System.out.println(sB.toString());
    }
}

public class Test {
}
